package com.lookme.lmtool.cracker.filter.color;

import com.jhlabs.image.PosterizeFilter;
import com.jhlabs.image.TritoneFilter;
import com.lookme.lmtool.cracker.CrackerConstants;
import com.lookme.lmtool.cracker.annotation.FilterAnnotation;
import com.lookme.lmtool.cracker.annotation.ParamAnnotation;
import com.lookme.lmtool.cracker.filter.AbstractFilter;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

import java.awt.image.BufferedImageOp;

@FilterAnnotation(groupName = CrackerConstants.FILTER_GROUP_NAME_COLOR,name="三阶色调整",filterClass = TritoneFilter.class)
public class FilterTritone extends AbstractFilter {
    @XStreamAsAttribute
    @ParamAnnotation(name = "阴影颜色", desc = "阴影颜色",inputType = ParamAnnotation.InputType.ColorPicker,margin = {0,50,0,0})
    private int shadowColor = 0xff000000;
    @XStreamAsAttribute
    @ParamAnnotation(name = "中间色", desc = "中间色",inputType = ParamAnnotation.InputType.ColorPicker,margin = {0,50,0,0})
    private int midColor = 0xff888888;
    @XStreamAsAttribute
    @ParamAnnotation(name = "高光颜色", desc = "高光颜色",inputType = ParamAnnotation.InputType.ColorPicker,margin = {0,50,0,0})
    private int highColor = 0xffffffff;


    @Override
    public BufferedImageOp getFilter() {
        TritoneFilter filter= new TritoneFilter();
        filter.setShadowColor(shadowColor);
        filter.setMidColor(midColor);
        filter.setHighColor(highColor);
        return filter;
    }
}
